<admintpl file="header" />
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a>订单管理</a></li>
    </ul>
    <form class="well form-search" method="post" action="{:U('Bdrunpeople/order')}">
        工号：<input type="text" name="job_number" style="width: 100px;" value="{$formget.job_number}">
        跑客姓名：<input type="text" name="dispatch_name" style="width: 100px;" value="{$formget.dispatch_name}" placeholder="请输入关键字...">
        下单时间：
        <input type="text" name="start_time" class="js-date" value="{$formget.start_time|default=''}" style="width: 80px;" autocomplete="off">-
        <input type="text" class="js-date" name="end_time" value="{$formget.end_time}" style="width: 80px;" autocomplete="off"> &nbsp; &nbsp;
        &nbsp;&nbsp;<br>
        订单类型：
        <select class="select_2" name="order_type"  style="width: 80px;" >
            <option value='-1'>全部</option>
            <option value='1'{:I("post.order_type")==1?selected:''}>送东西</option>
            <option value='2'{:I("post.order_type")==2?selected:''}>取东西</option>
            <option value='3'{:I("post.order_type")==3?selected:''}>买东西</option>
            <option value='4'{:I("post.order_type")==4?selected:''}>代排队</option>
        </select> &nbsp;&nbsp;
        订单状态：
        <select class="select_2" name="status"  style="width: 80px;" >
            <option value='-1' selected>全部</option>
            <option value='0'{:I("post.status")==0?selected:''}>未处理</option>
            <option value='1'{:I("post.status")==1?selected:''}>待分配</option>
            <option value='2'{:I("post.status")==2?selected:''}>已分配</option>
            <option value='3'{:I("post.status")==3?selected:''}>已到达</option>
            <option value='4'{:I("post.status")==4?selected:''}>已拍照</option>
            <option value='5'{:I("post.status")==5?selected:''}>已取件</option>
            <option value='6'{:I("post.status")==6?selected:''}>已送达</option>
            <option value='7'{:I("post.status")==7?selected:''}>已完成</option>
            <option value='9'{:I("post.status")==9?selected:''}>已取消</option>
        </select> &nbsp;&nbsp;
        是否预约单：
        <select class="select_2" name="is_reservation"  style="width: 70px;" >
            <option value='-1'>全部</option>
            <option value='0'{:I("post.is_reservation")==0?selected:''}>否</option>
            <option value='1'{:I("post.is_reservation")==1?selected:''}>是</option>
        </select> &nbsp;&nbsp;
        <input type="submit" class="btn btn-primary" value="搜索" />
    </form>
    <form method="post" class="js-ajax-form">
<!--        <div class="table-actions">
            <button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('Bdrunpeople/sign',array('sign'=>1))}" data-subcheck="true">签约</button>
            <button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('Bdrunpeople/cancelsign',array('unsign'=>1))}" data-subcheck="true">取消签约</button>
            <button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('Bdrunpeople/incubator',array('incubator'=>1))}" data-subcheck="true">领取保温箱</button>
            <button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('Bdrunpeople/freezee',array('freezee'=>1))}" data-subcheck="true" data-msg="您确定冻结账户吗？">冻结</button>
            <button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('Bdrunpeople/cancelfreezee',array('cancelfreezee'=>1))}" data-subcheck="true" data-msg="您确定启用账户吗？">启用</button>
            <button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('Bdrunpeople/cancelaudit',array('audit'=>1))}" data-subcheck="true">取消审核</button>
        </div>-->
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th width="15"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
                <th align="center">序号</th>
                <th>{:L('ORDER_NUMBER')}</th>
                <th>{:L('ORDER_TIME')}</th>
                <th>{:L('ORDER_TYPE')}</th>
                <th>{:L('STATUS')}</th>
                <th>{:L('PAY_METHOD')}</th>
                <th>{:L('JOB_NUMBER')}</th>
                <th>{:L('DISPATCH_NAME')}</th>
                <th>{:L('MOBILE')}</th>
                <th>{:L('ORDER_AMOUNT')}</th>
                <th>{:L('REAL_AMOUNT')}</th>
                <th>{:L('CITY')}</th>
                <th align="center">{:L('ACTIONS')}</th>
            </tr>
            </thead>
            <tbody>
            <php>$order_types=array("1"=>'送东西',"2"=>'取东西',"3"=>'买东西',"4"=>'代排队');
                $order_status=array("0"=>'未处理',"1"=>'待分配',"2"=>'已分配',"3"=>'已到达',"4"=>'已拍照',"5"=>"已取件","6"=>"已送达","7"=>"已完成","9"=>'已取消');
                $pay_methods=array("1"=>'直接支付（微信，支付宝）',"2"=>'钱包');
            </php>
            <foreach name="lists" item="vo" key="k">
                <tr>
                    <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.order_id}" title="ID:{$vo.order_id}"></td>
                    <td align="center">{$k+1}</td>
                    <td>{$vo.order_number}</td>
                    <td>{$vo.order_time}</td>
                    <td>{$order_types[$vo[order_type]]}</td>
                    <td>{$order_status[$vo[status]]}</td>
                    <td>{$pay_methods[$vo[pay_method]]}</td>
             <!--       <td>{$dispatchs[$vo['dispatch_id']]['job_number']}</td>
                    <td>{$dispatchs[$vo['dispatch_id']]['dispatch_name']}</td>
                    <td>{$dispatchs[$vo['dispatch_id']]['mobile']}</td>-->
                    <td>{$vo.job_number}</td>
                    <td>{$vo.dispatch_name}</td>
                    <td>{$vo.mobile}</td>

                    <td>{$vo.order_amount}</td>
                    <td>{$vo.real_amount}</td>
                    <td>{$citys[$vo['city_id']]['city_name']}</td>
                    <td align="center">
                        <a href="{:U('bdrunpeople/order_edit',array('id'=>empty($vo['order_id'])?'':$vo['order_id']))}">{:L('MODIFY')}</a> |
                        <a href="{:U('bdrunpeople/order_delete',array('id'=>empty($vo['order_id'])?'':$vo['order_id']))}" class="js-ajax-delete">{:L('DELETE')}</a>|
                        <a href="{:U('bdrunpeople/order_see',array('id'=>empty($vo['order_id'])?'':$vo['order_id']))}">{:L('SEE')}</a>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <if condition="empty($lists)">
            <div style="padding: 30px;text-align: center;color: #999999">
                <i class="fa fa-database" style="font-size: 38px"></i><br />
                暂无数据
            </div>
        </if>
        <div class="pagination">{$page}</div>
    </form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
<script>
    setCookie('refersh_time', 0);
    function refersh_window() {
        var refersh_time = getCookie('refersh_time');
        if (refersh_time == 1) {
            window.location = "{:U('Bdrunpeople/order',$formget)}";
        }
    }
    setInterval(function() {
        refersh_window();
    }, 2000);
    $(function() {
        setCookie("refersh_time", 0);
        Wind.use('ajaxForm', 'artDialog', 'iframeTools', function() {
            //批量移动
            $('.js-articles-move').click(function(e) {
                var str = 0;
                var id = tag = '';
                $("input[name='ids[]']").each(function() {
                    if ($(this).attr('checked')) {
                        str = 1;
                        id += tag + $(this).val();
                        tag = ',';
                    }
                });
                if (str == 0) {
                    art.dialog.through({
                        id : 'error',
                        icon : 'error',
                        content : '您没有勾选信息，无法进行操作！',
                        cancelVal : '关闭',
                        cancel : true
                    });
                    return false;
                }
                var $this = $(this);
            });
        });

    });
</script>
</body>
</html>